﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminDefault.Master"
  AutoEventWireup="true" CodeBehind="Introduction.aspx.cs" Inherits="NguyenHoa.Web.Admin.Introduction" %>

<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxHtmlEditor.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxHtmlEditor" TagPrefix="dxhe" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div>
    <div style="float: left; padding-top: 0px;">
      <asp:Label ID="Label1" runat="server" CssClass="CommonFont" Text="<%$Resources:Strings, Language %>"></asp:Label>
      :
    </div>
    <div style="float: left; padding-left: 5px;">
      <dxe:ASPxComboBox ID="cbxLanguage" ClientInstanceName="cbxLanguage" runat="server"
        ValueType="System.Int32" DataSourceID="xdsLanguage" TextField="Value" ValueField="Id">
        <ButtonStyle Width="11px">
        </ButtonStyle>
        <ValidationSettings>
          <ErrorImage Width="14px" />
        </ValidationSettings>
        <ClientSideEvents ValueChanged="function(s,e){oncbxLanguage_ValueChanged(s,e);}" />
      </dxe:ASPxComboBox>
    </div>
    <div style="clear: both; padding-top: 10px;" id="divSummary" runat="server">
      <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Strings, Summary %>"></asp:Literal>:
      <dxhe:ASPxHtmlEditor ID="htmlSummary" ClientInstanceName="htmlSummary" runat="server"
        Height="200px">
        <SettingsImageUpload UploadImageFolder="~/Upload/Images/">
          <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png">
          </ValidationSettings>
        </SettingsImageUpload>
        <Images>
          <DialogFormCloseButton Width="18px" />
          <ToolbarPopOut Width="6px" />
        </Images>
        <PartsRoundPanel>
          <TopLeftCorner Width="9px" />
          <NoHeaderTopLeftCorner Width="9px" />
          <TopRightCorner Width="9px" />
          <NoHeaderTopRightCorner Width="9px" />
          <BottomRightCorner Width="9px" />
          <BottomLeftCorner Width="9px" />
        </PartsRoundPanel>
      </dxhe:ASPxHtmlEditor>
    </div>
    <div style="clear: both; padding-top: 20px;">
      <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Strings, Content %>"></asp:Literal>:
      <dxhe:ASPxHtmlEditor ID="htmlEditor" ClientInstanceName="htmlEditor" runat="server">
        <SettingsImageUpload UploadImageFolder="~/Upload/Images/">
          <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png">
          </ValidationSettings>
        </SettingsImageUpload>
        <Images>
          <DialogFormCloseButton Width="18px" />
          <ToolbarPopOut Width="6px" />
        </Images>
        <PartsRoundPanel>
          <TopLeftCorner Width="9px" />
          <NoHeaderTopLeftCorner Width="9px" />
          <TopRightCorner Width="9px" />
          <NoHeaderTopRightCorner Width="9px" />
          <BottomRightCorner Width="9px" />
          <BottomLeftCorner Width="9px" />
        </PartsRoundPanel>
      </dxhe:ASPxHtmlEditor>
    </div>
    <div style="clear: both; padding-top: 8px;">
      <dxe:ASPxButton ID="btnSave" runat="server" Text="<%$ Resources:Strings, Save %>"
        AutoPostBack="False">
        <ClientSideEvents Click="function(s, e) {onSave();}" />
      </dxe:ASPxButton>
    </div>
  </div>
  <div>
    <dxcb:ASPxCallback ID="ctrlCallback" ClientInstanceName="ctrlCallback" runat="server"
      OnCallback="ctrlCallback_Callback">
      <ClientSideEvents CallbackComplete="function(s, e){onCtrlCallback_CallbackComplete(s, e);}" />
    </dxcb:ASPxCallback>
    <asp:XmlDataSource ID="xdsLanguage" runat="server" XPath="Items/LanguageDisplay/Status">
    </asp:XmlDataSource>
  </div>

  <script type="text/javascript" language="javascript">
    function onSave() {
      ctrlCallback.SendCallback('Save|');
    }

    function onCtrlCallback_CallbackComplete(s, e) {
      if (e.parameter.indexOf('Save') >= 0) {
        if (e.result != '')
          alertMessage(e.result);
        else
          alertMessage('<%=GetGlobalResourceObject("Messages", "ERR0005") %>');
      }
      else if (e.parameter.indexOf('ChangeLanguage') >= 0) {
        var data = e.result.split('|');
        htmlEditor.SetHtml(data[0]);
        if (data.length > 1) {
          htmlSummary.SetHtml(data[1]);
        }
      }
    }

    function oncbxLanguage_ValueChanged(s, e) {
      ctrlCallback.SendCallback('ChangeLanguage|');
    }
  </script>

</asp:Content>
